﻿using Hippo.Common.Extensions;

namespace Hippo.Common
{
    public class RegexFactory
    {
        public string HelpArgumentExpression
        {
            get { return @"^[/-](help|h|\?)$"; }
        }

        /// <summary>
        /// Get regular expression to match a command line argument
        /// </summary>
        /// <param name="argumentKeys">Keys for the option like: ?, help, h</param>
        /// <returns>The regular expression that matches an option</returns>
        public string GetArgumentExpression(params string[] argumentKeys)
        {
            return string.Format("^[/-]({0})([:=](?<value>.*))?$", argumentKeys.ToDelimitedString("|"));
        }
    }
}
